﻿using System;
using System.Xml;
using UnityEngine;

namespace XMainClient
{
	// Token: 0x02000AAC RID: 2732
	internal class AIRunTimeEntryTaskNode : AIRunTimeRootNode
	{
		// Token: 0x0600A53F RID: 42303 RVA: 0x001CBC6C File Offset: 0x001C9E6C
		public AIRunTimeEntryTaskNode(XmlElement node) : base(node)
		{
			for (int i = 0; i < node.Attributes.Count; i++)
			{
				string attr_name = node.Attributes[i].Name;
				if (attr_name.Length >= 3)
				{
					string name = attr_name.Substring(2);
					if (attr_name.StartsWith("F_"))
					{
						base.Data.SetFloatByName(name, float.Parse(node.Attributes[i].Value));
					}
					else if (attr_name.StartsWith("S_"))
					{
						base.Data.SetStringByName(name, node.Attributes[i].Value);
					}
					else if (attr_name.StartsWith("I_"))
					{
						base.Data.SetIntByName(name, int.Parse(node.Attributes[i].Value));
					}
					else if (attr_name.StartsWith("B_"))
					{
						base.Data.SetBoolByName(name, node.Attributes[i].Value != "0");
					}
					else if (attr_name.StartsWith("V_"))
					{
                        string[] array = node.Attributes[i].Value.Split(new char[]
                            {
                                            ':'
                            });
                        base.Data.SetVector3ByName(name, new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2])));
                    }

				}
			}
		}
	}
}
